﻿using System.ServiceModel;
using SpectrumAnalyser.Common.ServiceHeaders;

namespace SpectrumAnalyser.Services.Common.Extensions
{
    public static class OperationContextExtensions
    {
        public static InstanceNameHeader GetInstanceNameHeader(this OperationContext operationContext)
        {
            return OperationContext.Current.IncomingMessageHeaders
                                   .GetHeader<InstanceNameHeader>(InstanceNameHeader.NAME, InstanceNameHeader.NAMESPACE);
        }
    }
}